package com.domain.ssh.springmvc.controller;


import com.domain.ssh.springmvc.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

/**
 * 用户管理
 */
@Controller
@RequestMapping(value = "user")
public class UserController {

    @Autowired
    UserService userService;

    @RequestMapping(value = "list" ,method = RequestMethod.GET)
    public String userList(Model model){
        model.addAttribute("users",userService.getUsers());
        return "user_list";
    }

}
